const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  publicPath: '/cloudWarehouse/',
  chainWebpack: config => {
    // 在生产环境下给每个打包后的文件名添加版本号
    if (process.env.NODE_ENV === 'production') {
      config.output.filename('js/[name].[contenthash].v.1.0.1.js').chunkFilename('js/[name].[contenthash].v.1.0.1.js')
    }
  },
  css: {
    extract: {
      filename: 'css/[name].[contenthash].v.1.0.1.css',
      chunkFilename: 'css/[name].[contenthash].v.1.0.1.css'
    }
  },
  devServer: {
    allowedHosts: 'all',
    proxy: {
      '/proxy-api': {
        target: 'http://192.168.1.4:8889',
        // changeOrigin: true,
        pathRewrite: {
          '^/proxy-api': ''
        }
      }
    }
    // disableHostCheck: true
  }
})
